import os
import django

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'travel_recommend.settings')
django.setup()
from user.serializers import User, UserModelSerializer, UserComments, UserCommentsSerializer
from travel.serializers import Travel, TravelModelSerializer

# 第一次登录，没有评分过景点的用户，使用未登录推荐
def check_first_login_user(user_id):
    comments = UserComments.objects.filter(user=user_id).values()
    if not comments:
        un_login_analysis()


# 未登录推荐
def un_login_analysis():
    # 获取所有景点
    all_travels = Travel.objects.all().values()

    pass

# 获取用户和景点相识度矩阵
def get_similar_matrix(comments):
    pass

# 基于用户行为推荐
def similar_user_recom(user_id, comments):
    pass
